.class public Lcom/brixd/niceapp/service/AppService;
.super Ljava/lang/Object;
.source "AppService.java"


# static fields
.field private static final COMMUNITY_APP_MODELS_VERSION:I = 0x1

.field private static final KEY_SOURCE:Ljava/lang/String; = "source"

.field private static final KEY_VERSION:Ljava/lang/String; = "version"

.field private static mContext:Landroid/content/Context;

.field private static mDaoSession:Lcom/brixd/niceapp/db/DaoSession;

.field private static mInstance:Lcom/brixd/niceapp/service/AppService;


# direct methods
.method private constructor <init>(Landroid/content/Context;)V
    .registers 8
    .param p1, "context"    # Landroid/content/Context;

    .prologue
    .line 51
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 52
    sput-object p1, Lcom/brixd/niceapp/service/AppService;->mContext:Landroid/content/Context;

    .line 53
    new-instance v2, Lcom/brixd/niceapp/db/DatabaseOpenHelper;

    sget-object v3, Lcom/brixd/niceapp/service/AppService;->mContext:Landroid/content/Context;

    const-string v4, "zuimei.sqlite"

    const/4 v5, 0x0

    invoke-direct {v2, v3, v4, v5}, Lcom/brixd/niceapp/db/DatabaseOpenHelper;-><init>(Landroid/content/Context;Ljava/lang/String;Landroid/database/sqlite/SQLiteDatabase$CursorFactory;)V

    .line 54
    .local v2, "helper":Lcom/brixd/niceapp/db/DaoMaster$OpenHelper;
    invoke-virtual {v2}, Lcom/brixd/niceapp/db/DaoMaster$OpenHelper;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v1

    .line 55
    .local v1, "db":Landroid/database/sqlite/SQLiteDatabase;
    new-instance v0, Lcom/brixd/niceapp/db/DaoMaster;

    invoke-direct {v0, v1}, Lcom/brixd/niceapp/db/DaoMaster;-><init>(Landroid/database/sqlite/SQLiteDatabase;)V

    .line 56
    .local v0, "daoMaster":Lcom/brixd/niceapp/db/DaoMaster;
    invoke-virtual {v0}, Lcom/brixd/niceapp/db/DaoMaster;->newSession()Lcom/brixd/niceapp/db/DaoSession;

    move-result-object v3

    sput-object v3, Lcom/brixd/niceapp/service/AppService;->mDaoSession:Lcom/brixd/niceapp/db/DaoSession;

    .line 57
    return-void
.end method

.method static synthetic access$000()V
    .registers 0

    .prologue
    .line 41
    invoke-static {}, Lcom/brixd/niceapp/service/AppService;->deleteExpiredData()V

    return-void
.end method

.method static synthetic access$100()V
    .registers 0

    .prologue
    .line 41
    invoke-static {}, Lcom/brixd/niceapp/service/AppService;->deleteCommunityExpiredData()V

    return-void
.end method

.method static synthetic access$200(I)V
    .registers 1
    .param p0, "x0"    # I

    .prologue
    .line 41
    invoke-static {p0}, Lcom/brixd/niceapp/service/AppService;->deleteCommonExpiredData(I)V

    return-void
.end method

.method public static cacheAlbumHistory(Ljava/lang/String;)V
    .registers 3
    .param p0, "data"    # Ljava/lang/String;

    .prologue
    .line 262
    sget-object v0, Lcom/brixd/niceapp/service/AppService;->mContext:Landroid/content/Context;

    invoke-static {v0}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    move-result-object v0

    const-string v1, "AlbumHistoryData"

    invoke-virtual {v0, v1, p0}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->setPref(Ljava/lang/String;Ljava/lang/String;)V

    .line 263
    return-void
.end method

.method public static cacheAppModelsJsonData(Lorg/json/JSONObject;)V
    .registers 4
    .param p0, "jsonData"    # Lorg/json/JSONObject;

    .prologue
    .line 79
    sget-object v0, Lcom/brixd/niceapp/service/AppService;->mContext:Landroid/content/Context;

    invoke-static {v0}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    move-result-object v0

    const-string v1, "FirstLoadAppsJsonData"

    invoke-virtual {p0}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->setPref(Ljava/lang/String;Ljava/lang/String;)V

    .line 83
    return-void
.end method

.method public static cacheCategoryAppsJsonData(Lorg/json/JSONObject;)V
    .registers 4
    .param p0, "jsonData"    # Lorg/json/JSONObject;

    .prologue
    .line 94
    sget-object v0, Lcom/brixd/niceapp/service/AppService;->mContext:Landroid/content/Context;

    invoke-static {v0}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    move-result-object v0

    const-string v1, "FirstLoadCategoryJsonData"

    invoke-virtual {p0}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->setPref(Ljava/lang/String;Ljava/lang/String;)V

    .line 95
    return-void
.end method

.method public static cacheCommonJsonData(Lorg/json/JSONObject;Lcom/brixd/niceapp/activity/fragment/CardViewPagerFragment$CardType;)V
    .registers 5
    .param p0, "jsonData"    # Lorg/json/JSONObject;
    .param p1, "type"    # Lcom/brixd/niceapp/activity/fragment/CardViewPagerFragment$CardType;

    .prologue
    .line 353
    sget-object v0, Lcom/brixd/niceapp/service/AppService;->mContext:Landroid/content/Context;

    invoke-static {v0}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    move-result-object v0

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "FirstLoadCommonJsonData"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {p0}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->setPref(Ljava/lang/String;Ljava/lang/String;)V

    .line 354
    return-void
.end method

.method public static cacheCommunityAppModelsData(Ljava/lang/String;I)V
    .registers 8
    .param p0, "jsonData"    # Ljava/lang/String;
    .param p1, "type"    # I
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lorg/json/JSONException;
        }
    .end annotation

    .prologue
    .line 151
    new-instance v0, Lorg/json/JSONObject;

    invoke-direct {v0}, Lorg/json/JSONObject;-><init>()V

    .line 152
    .local v0, "jsonObject":Lorg/json/JSONObject;
    const-string v1, "version"

    const/4 v2, 0x1

    invoke-virtual {v0, v1, v2}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    .line 153
    const-string v1, "source"

    invoke-virtual {v0, v1, p0}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    .line 155
    sget-object v1, Lcom/brixd/niceapp/community/AbsCommunityBaseFragment$AppListType;->Type_Hot:Lcom/brixd/niceapp/community/AbsCommunityBaseFragment$AppListType;

    invoke-virtual {v1}, Lcom/brixd/niceapp/community/AbsCommunityBaseFragment$AppListType;->ordinal()I

    move-result v1

    if-ne p1, v1, :cond_3b

    .line 156
    sget-object v1, Lcom/brixd/niceapp/service/AppService;->mContext:Landroid/content/Context;

    invoke-static {v1}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    move-result-object v1

    const-string v2, "CommunityAppHotLastUpdatedTime"

    invoke-static {}, Ljava/util/Calendar;->getInstance()Ljava/util/Calendar;

    move-result-object v3

    invoke-virtual {v3}, Ljava/util/Calendar;->getTimeInMillis()J

    move-result-wide v4

    invoke-virtual {v1, v2, v4, v5}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->setPref(Ljava/lang/String;J)V

    .line 157
    sget-object v1, Lcom/brixd/niceapp/service/AppService;->mContext:Landroid/content/Context;

    invoke-static {v1}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    move-result-object v1

    const-string v2, "CommunityAppHot"

    invoke-virtual {v0}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->setPref(Ljava/lang/String;Ljava/lang/String;)V

    .line 163
    :cond_3a
    :goto_3a
    return-void

    .line 158
    :cond_3b
    sget-object v1, Lcom/brixd/niceapp/community/AbsCommunityBaseFragment$AppListType;->Type_New:Lcom/brixd/niceapp/community/AbsCommunityBaseFragment$AppListType;

    invoke-virtual {v1}, Lcom/brixd/niceapp/community/AbsCommunityBaseFragment$AppListType;->ordinal()I

    move-result v1

    if-ne p1, v1, :cond_3a

    .line 159
    sget-object v1, Lcom/brixd/niceapp/service/AppService;->mContext:Landroid/content/Context;

    invoke-static {v1}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    move-result-object v1

    const-string v2, "CommunityAppNewLastUpdatedTime"

    invoke-static {}, Ljava/util/Calendar;->getInstance()Ljava/util/Calendar;

    move-result-object v3

    invoke-virtual {v3}, Ljava/util/Calendar;->getTimeInMillis()J

    move-result-wide v4

    invoke-virtual {v1, v2, v4, v5}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->setPref(Ljava/lang/String;J)V

    .line 160
    sget-object v1, Lcom/brixd/niceapp/service/AppService;->mContext:Landroid/content/Context;

    invoke-static {v1}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    move-result-object v1

    const-string v2, "CommunityAppNew"

    invoke-virtual {v0}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->setPref(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_3a
.end method

.method public static cacheCommunityRankingAppsJsonData(Lorg/json/JSONObject;)V
    .registers 4
    .param p0, "jsonData"    # Lorg/json/JSONObject;

    .prologue
    .line 98
    sget-object v0, Lcom/brixd/niceapp/service/AppService;->mContext:Landroid/content/Context;

    invoke-static {v0}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    move-result-object v0

    const-string v1, "CommunityRankingAppsCache"

    invoke-virtual {p0}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->setPref(Ljava/lang/String;Ljava/lang/String;)V

    .line 99
    return-void
.end method

.method public static cacheCommunityRankingUsersJsonData(Lorg/json/JSONObject;)V
    .registers 4
    .param p0, "jsonData"    # Lorg/json/JSONObject;

    .prologue
    .line 102
    sget-object v0, Lcom/brixd/niceapp/service/AppService;->mContext:Landroid/content/Context;

    invoke-static {v0}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    move-result-object v0

    const-string v1, "CommunityRankingUsers"

    invoke-virtual {p0}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->setPref(Ljava/lang/String;Ljava/lang/String;)V

    .line 103
    return-void
.end method

.method public static cacheTagsForSearch(Lorg/json/JSONArray;)V
    .registers 4
    .param p0, "jsonArray"    # Lorg/json/JSONArray;

    .prologue
    .line 106
    sget-object v0, Lcom/brixd/niceapp/service/AppService;->mContext:Landroid/content/Context;

    invoke-static {v0}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    move-result-object v0

    const-string v1, "TagsForSearch"

    invoke-virtual {p0}, Lorg/json/JSONArray;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->setPref(Ljava/lang/String;Ljava/lang/String;)V

    .line 107
    return-void
.end method

.method public static cacheTopicAppModelsJsonData(Lorg/json/JSONObject;I)V
    .registers 5
    .param p0, "jsonData"    # Lorg/json/JSONObject;
    .param p1, "topicId"    # I

    .prologue
    .line 86
    sget-object v0, Lcom/brixd/niceapp/service/AppService;->mContext:Landroid/content/Context;

    invoke-static {v0}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    move-result-object v0

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "FirstLoadTopicAppsJsonData_"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {p0}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->setPref(Ljava/lang/String;Ljava/lang/String;)V

    .line 87
    return-void
.end method

.method public static cacheTopicModelsJsonData(Lorg/json/JSONObject;)V
    .registers 4
    .param p0, "jsonData"    # Lorg/json/JSONObject;

    .prologue
    .line 90
    sget-object v0, Lcom/brixd/niceapp/service/AppService;->mContext:Landroid/content/Context;

    invoke-static {v0}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    move-result-object v0

    const-string v1, "FirstLoadTopicJsonData"

    invoke-virtual {p0}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->setPref(Ljava/lang/String;Ljava/lang/String;)V

    .line 91
    return-void
.end method

.method public static clearCommonEstimate(I)V
    .registers 3
    .param p0, "type"    # I

    .prologue
    .line 387
    new-instance v0, Ljava/lang/Thread;

    new-instance v1, Lcom/brixd/niceapp/service/AppService$4;

    invoke-direct {v1, p0}, Lcom/brixd/niceapp/service/AppService$4;-><init>(I)V

    invoke-direct {v0, v1}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V

    .line 392
    invoke-virtual {v0}, Ljava/lang/Thread;->start()V

    .line 393
    return-void
.end method

.method public static clearCommunityEstimate()V
    .registers 2

    .prologue
    .line 318
    new-instance v0, Ljava/lang/Thread;

    new-instance v1, Lcom/brixd/niceapp/service/AppService$3;

    invoke-direct {v1}, Lcom/brixd/niceapp/service/AppService$3;-><init>()V

    invoke-direct {v0, v1}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V

    .line 323
    invoke-virtual {v0}, Ljava/lang/Thread;->start()V

    .line 324
    return-void
.end method

.method public static clearEstimate()V
    .registers 2

    .prologue
    .line 283
    new-instance v0, Ljava/lang/Thread;

    new-instance v1, Lcom/brixd/niceapp/service/AppService$2;

    invoke-direct {v1}, Lcom/brixd/niceapp/service/AppService$2;-><init>()V

    invoke-direct {v0, v1}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V

    .line 288
    invoke-virtual {v0}, Ljava/lang/Thread;->start()V

    .line 289
    return-void
.end method

.method public static convertToEnhanceTagModels(Ljava/util/List;)Ljava/util/List;
    .registers 7
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List",
            "<",
            "Lcom/brixd/niceapp/model/TagModel;",
            ">;)",
            "Ljava/util/List",
            "<",
            "Lcom/zuimeia/ui/tag/enhance/EnhanceTagModel;",
            ">;"
        }
    .end annotation

    .prologue
    .line 123
    .local p0, "list":Ljava/util/List;, "Ljava/util/List<Lcom/brixd/niceapp/model/TagModel;>;"
    new-instance v1, Ljava/util/ArrayList;

    invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V

    .line 125
    .local v1, "enhanceTagModels":Ljava/util/List;, "Ljava/util/List<Lcom/zuimeia/ui/tag/enhance/EnhanceTagModel;>;"
    if-nez p0, :cond_8

    .line 134
    :cond_7
    return-object v1

    .line 129
    :cond_8
    invoke-interface {p0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v3

    :goto_c
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-eqz v4, :cond_7

    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/brixd/niceapp/model/TagModel;

    .line 130
    .local v2, "tagModel":Lcom/brixd/niceapp/model/TagModel;
    new-instance v0, Lcom/zuimeia/ui/tag/enhance/EnhanceTagModel;

    invoke-virtual {v2}, Lcom/brixd/niceapp/model/TagModel;->getTitle()Ljava/lang/String;

    move-result-object v4

    const/4 v5, 0x0

    invoke-direct {v0, v4, v2, v5}, Lcom/zuimeia/ui/tag/enhance/EnhanceTagModel;-><init>(Ljava/lang/String;Ljava/lang/Object;Z)V

    .line 131
    .local v0, "enhanceTagModel":Lcom/zuimeia/ui/tag/enhance/EnhanceTagModel;
    invoke-interface {v1, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    goto :goto_c
.end method

.method private static deleteCommonExpiredData(I)V
    .registers 9
    .param p0, "type"    # I

    .prologue
    .line 396
    invoke-static {}, Ljava/util/Calendar;->getInstance()Ljava/util/Calendar;

    move-result-object v0

    .line 397
    .local v0, "curTime":Ljava/util/Calendar;
    const/4 v2, 0x5

    const/16 v3, -0x1e

    invoke-virtual {v0, v2, v3}, Ljava/util/Calendar;->add(II)V

    .line 398
    sget-object v2, Lcom/brixd/niceapp/service/AppService;->mDaoSession:Lcom/brixd/niceapp/db/DaoSession;

    invoke-virtual {v2}, Lcom/brixd/niceapp/db/DaoSession;->getCommonEstimateEntityDao()Lcom/brixd/niceapp/db/CommonEstimateEntityDao;

    move-result-object v1

    .line 399
    .local v1, "dao":Lcom/brixd/niceapp/db/CommonEstimateEntityDao;
    invoke-virtual {v1}, Lcom/brixd/niceapp/db/CommonEstimateEntityDao;->queryBuilder()Lde/greenrobot/dao/query/QueryBuilder;

    move-result-object v2

    sget-object v3, Lcom/brixd/niceapp/db/CommonEstimateEntityDao$Properties;->TimeUpdated:Lde/greenrobot/dao/Property;

    .line 400
    invoke-virtual {v0}, Ljava/util/Calendar;->getTimeInMillis()J

    move-result-wide v4

    invoke-static {v4, v5}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v4

    invoke-virtual {v3, v4}, Lde/greenrobot/dao/Property;->lt(Ljava/lang/Object;)Lde/greenrobot/dao/query/WhereCondition;

    move-result-object v3

    const/4 v4, 0x1

    new-array v4, v4, [Lde/greenrobot/dao/query/WhereCondition;

    const/4 v5, 0x0

    sget-object v6, Lcom/brixd/niceapp/db/CommonEstimateEntityDao$Properties;->Type:Lde/greenrobot/dao/Property;

    .line 401
    invoke-static {p0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v7

    invoke-virtual {v6, v7}, Lde/greenrobot/dao/Property;->eq(Ljava/lang/Object;)Lde/greenrobot/dao/query/WhereCondition;

    move-result-object v6

    aput-object v6, v4, v5

    .line 400
    invoke-virtual {v2, v3, v4}, Lde/greenrobot/dao/query/QueryBuilder;->where(Lde/greenrobot/dao/query/WhereCondition;[Lde/greenrobot/dao/query/WhereCondition;)Lde/greenrobot/dao/query/QueryBuilder;

    move-result-object v2

    .line 402
    invoke-virtual {v2}, Lde/greenrobot/dao/query/QueryBuilder;->buildDelete()Lde/greenrobot/dao/query/DeleteQuery;

    move-result-object v2

    invoke-virtual {v2}, Lde/greenrobot/dao/query/DeleteQuery;->executeDeleteWithoutDetachingEntities()V

    .line 403
    return-void
.end method

.method private static deleteCommunityExpiredData()V
    .registers 6

    .prologue
    .line 327
    invoke-static {}, Ljava/util/Calendar;->getInstance()Ljava/util/Calendar;

    move-result-object v0

    .line 328
    .local v0, "curTime":Ljava/util/Calendar;
    const/4 v2, 0x5

    const/16 v3, -0x1e

    invoke-virtual {v0, v2, v3}, Ljava/util/Calendar;->add(II)V

    .line 329
    sget-object v2, Lcom/brixd/niceapp/service/AppService;->mDaoSession:Lcom/brixd/niceapp/db/DaoSession;

    invoke-virtual {v2}, Lcom/brixd/niceapp/db/DaoSession;->getCommunityEstimateEntityDao()Lcom/brixd/niceapp/db/CommunityEstimateEntityDao;

    move-result-object v1

    .line 330
    .local v1, "dao":Lcom/brixd/niceapp/db/CommunityEstimateEntityDao;
    invoke-virtual {v1}, Lcom/brixd/niceapp/db/CommunityEstimateEntityDao;->queryBuilder()Lde/greenrobot/dao/query/QueryBuilder;

    move-result-object v2

    sget-object v3, Lcom/brixd/niceapp/db/CommunityEstimateEntityDao$Properties;->TimeUpdated:Lde/greenrobot/dao/Property;

    invoke-virtual {v0}, Ljava/util/Calendar;->getTimeInMillis()J

    move-result-wide v4

    invoke-static {v4, v5}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v4

    invoke-virtual {v3, v4}, Lde/greenrobot/dao/Property;->lt(Ljava/lang/Object;)Lde/greenrobot/dao/query/WhereCondition;

    move-result-object v3

    const/4 v4, 0x0

    new-array v4, v4, [Lde/greenrobot/dao/query/WhereCondition;

    invoke-virtual {v2, v3, v4}, Lde/greenrobot/dao/query/QueryBuilder;->where(Lde/greenrobot/dao/query/WhereCondition;[Lde/greenrobot/dao/query/WhereCondition;)Lde/greenrobot/dao/query/QueryBuilder;

    move-result-object v2

    .line 331
    invoke-virtual {v2}, Lde/greenrobot/dao/query/QueryBuilder;->buildDelete()Lde/greenrobot/dao/query/DeleteQuery;

    move-result-object v2

    invoke-virtual {v2}, Lde/greenrobot/dao/query/DeleteQuery;->executeDeleteWithoutDetachingEntities()V

    .line 332
    return-void
.end method

.method private static deleteExpiredData()V
    .registers 6

    .prologue
    .line 292
    invoke-static {}, Ljava/util/Calendar;->getInstance()Ljava/util/Calendar;

    move-result-object v0

    .line 293
    .local v0, "curTime":Ljava/util/Calendar;
    const/4 v2, 0x5

    const/16 v3, -0x1e

    invoke-virtual {v0, v2, v3}, Ljava/util/Calendar;->add(II)V

    .line 294
    sget-object v2, Lcom/brixd/niceapp/service/AppService;->mDaoSession:Lcom/brixd/niceapp/db/DaoSession;

    invoke-virtual {v2}, Lcom/brixd/niceapp/db/DaoSession;->getEstimateEntityDao()Lcom/brixd/niceapp/db/EstimateEntityDao;

    move-result-object v1

    .line 295
    .local v1, "dao":Lcom/brixd/niceapp/db/EstimateEntityDao;
    invoke-virtual {v1}, Lcom/brixd/niceapp/db/EstimateEntityDao;->queryBuilder()Lde/greenrobot/dao/query/QueryBuilder;

    move-result-object v2

    sget-object v3, Lcom/brixd/niceapp/db/EstimateEntityDao$Properties;->TimeUpdated:Lde/greenrobot/dao/Property;

    invoke-virtual {v0}, Ljava/util/Calendar;->getTimeInMillis()J

    move-result-wide v4

    invoke-static {v4, v5}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v4

    invoke-virtual {v3, v4}, Lde/greenrobot/dao/Property;->lt(Ljava/lang/Object;)Lde/greenrobot/dao/query/WhereCondition;

    move-result-object v3

    const/4 v4, 0x0

    new-array v4, v4, [Lde/greenrobot/dao/query/WhereCondition;

    invoke-virtual {v2, v3, v4}, Lde/greenrobot/dao/query/QueryBuilder;->where(Lde/greenrobot/dao/query/WhereCondition;[Lde/greenrobot/dao/query/WhereCondition;)Lde/greenrobot/dao/query/QueryBuilder;

    move-result-object v2

    .line 296
    invoke-virtual {v2}, Lde/greenrobot/dao/query/QueryBuilder;->buildDelete()Lde/greenrobot/dao/query/DeleteQuery;

    move-result-object v2

    invoke-virtual {v2}, Lde/greenrobot/dao/query/DeleteQuery;->executeDeleteWithoutDetachingEntities()V

    .line 297
    return-void
.end method

.method public static getApplicationContext()Landroid/content/Context;
    .registers 1

    .prologue
    .line 75
    sget-object v0, Lcom/brixd/niceapp/service/AppService;->mContext:Landroid/content/Context;

    return-object v0
.end method

.method public static getCachedAlbumHistoryModel()Ljava/util/List;
    .registers 5
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/List",
            "<",
            "Lcom/brixd/niceapp/model/AlbumHolderModel;",
            ">;"
        }
    .end annotation

    .prologue
    .line 266
    const/4 v0, 0x0

    .line 268
    .local v0, "albumHolderModels":Ljava/util/List;, "Ljava/util/List<Lcom/brixd/niceapp/model/AlbumHolderModel;>;"
    sget-object v2, Lcom/brixd/niceapp/service/AppService;->mContext:Landroid/content/Context;

    invoke-static {v2}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    move-result-object v2

    const-string v3, "AlbumHistoryData"

    const-string v4, ""

    invoke-virtual {v2, v3, v4}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getPref(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 269
    .local v1, "jsonArray":Ljava/lang/String;
    invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v2

    if-nez v2, :cond_1e

    .line 271
    :try_start_15
    new-instance v2, Lorg/json/JSONArray;

    invoke-direct {v2, v1}, Lorg/json/JSONArray;-><init>(Ljava/lang/String;)V

    invoke-static {v2}, Lcom/brixd/niceapp/model/AlbumHolderModel;->parseAlbumHolderModels(Lorg/json/JSONArray;)Ljava/util/List;
    :try_end_1d
    .catch Lorg/json/JSONException; {:try_start_15 .. :try_end_1d} :catch_1f

    move-result-object v0

    .line 275
    :cond_1e
    :goto_1e
    return-object v0

    .line 272
    :catch_1f
    move-exception v2

    goto :goto_1e
.end method

.method public static getCachedAppModelsJsonData()Lorg/json/JSONObject;
    .registers 6

    .prologue
    const/4 v2, 0x0

    .line 138
    sget-object v3, Lcom/brixd/niceapp/service/AppService;->mContext:Landroid/content/Context;

    invoke-static {v3}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    move-result-object v3

    const-string v4, "FirstLoadAppsJsonData"

    const-string v5, ""

    invoke-virtual {v3, v4, v5}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getPref(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 139
    .local v1, "jsonData":Ljava/lang/String;
    const-string v3, ""

    invoke-virtual {v1, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_18

    .line 145
    :goto_17
    return-object v2

    .line 143
    :cond_18
    :try_start_18
    new-instance v3, Lorg/json/JSONObject;

    invoke-direct {v3, v1}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V
    :try_end_1d
    .catch Lorg/json/JSONException; {:try_start_18 .. :try_end_1d} :catch_1f

    move-object v2, v3

    goto :goto_17

    .line 144
    :catch_1f
    move-exception v0

    .line 145
    .local v0, "e":Lorg/json/JSONException;
    goto :goto_17
.end method

.method public static getCachedCategoryModelsJsonData()Lorg/json/JSONObject;
    .registers 6

    .prologue
    const/4 v2, 0x0

    .line 224
    sget-object v3, Lcom/brixd/niceapp/service/AppService;->mContext:Landroid/content/Context;

    invoke-static {v3}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    move-result-object v3

    const-string v4, "FirstLoadCategoryJsonData"

    const-string v5, ""

    invoke-virtual {v3, v4, v5}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getPref(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 225
    .local v1, "jsonData":Ljava/lang/String;
    const-string v3, ""

    invoke-virtual {v1, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_18

    .line 231
    :goto_17
    return-object v2

    .line 229
    :cond_18
    :try_start_18
    new-instance v3, Lorg/json/JSONObject;

    invoke-direct {v3, v1}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V
    :try_end_1d
    .catch Lorg/json/JSONException; {:try_start_18 .. :try_end_1d} :catch_1f

    move-object v2, v3

    goto :goto_17

    .line 230
    :catch_1f
    move-exception v0

    .line 231
    .local v0, "e":Lorg/json/JSONException;
    goto :goto_17
.end method

.method public static getCachedCommonJsonData(Lcom/brixd/niceapp/activity/fragment/CardViewPagerFragment$CardType;)Lorg/json/JSONObject;
    .registers 7
    .param p0, "type"    # Lcom/brixd/niceapp/activity/fragment/CardViewPagerFragment$CardType;

    .prologue
    const/4 v2, 0x0

    .line 357
    sget-object v3, Lcom/brixd/niceapp/service/AppService;->mContext:Landroid/content/Context;

    invoke-static {v3}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    move-result-object v3

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "FirstLoadCommonJsonData"

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    const-string v5, ""

    invoke-virtual {v3, v4, v5}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getPref(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 358
    .local v1, "jsonData":Ljava/lang/String;
    const-string v3, ""

    invoke-virtual {v1, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_29

    .line 364
    :goto_28
    return-object v2

    .line 362
    :cond_29
    :try_start_29
    new-instance v3, Lorg/json/JSONObject;

    invoke-direct {v3, v1}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V
    :try_end_2e
    .catch Lorg/json/JSONException; {:try_start_29 .. :try_end_2e} :catch_30

    move-object v2, v3

    goto :goto_28

    .line 363
    :catch_30
    move-exception v0

    .line 364
    .local v0, "e":Lorg/json/JSONException;
    goto :goto_28
.end method

.method public static getCachedCommunityAppModelsJsonData(I)Ljava/util/ArrayList;
    .registers 11
    .param p0, "type"    # I
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(I)",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/brixd/niceapp/community/model/CommunityAppModel;",
            ">;"
        }
    .end annotation

    .prologue
    .line 166
    const-string v5, ""

    .line 167
    .local v5, "jsonData":Ljava/lang/String;
    sget-object v7, Lcom/brixd/niceapp/community/AbsCommunityBaseFragment$AppListType;->Type_New:Lcom/brixd/niceapp/community/AbsCommunityBaseFragment$AppListType;

    invoke-virtual {v7}, Lcom/brixd/niceapp/community/AbsCommunityBaseFragment$AppListType;->ordinal()I

    move-result v7

    if-ne p0, v7, :cond_48

    .line 168
    sget-object v7, Lcom/brixd/niceapp/service/AppService;->mContext:Landroid/content/Context;

    invoke-static {v7}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    move-result-object v7

    const-string v8, "CommunityAppNew"

    const-string v9, ""

    invoke-virtual {v7, v8, v9}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getPref(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    .line 173
    :cond_18
    :goto_18
    const/4 v1, 0x0

    .line 174
    .local v1, "appModels":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/brixd/niceapp/community/model/CommunityAppModel;>;"
    invoke-static {v5}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v7

    if-nez v7, :cond_47

    .line 175
    new-instance v4, Lcom/google/gson/Gson;

    invoke-direct {v4}, Lcom/google/gson/Gson;-><init>()V

    .line 177
    .local v4, "gson":Lcom/google/gson/Gson;
    :try_start_24
    new-instance v6, Lorg/json/JSONObject;

    invoke-direct {v6, v5}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    .line 178
    .local v6, "jsonObject":Lorg/json/JSONObject;
    const-string v7, "version"

    invoke-virtual {v6, v7}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;)I

    move-result v7

    const/4 v8, 0x1

    if-ge v7, v8, :cond_5f

    .line 179
    new-instance v7, Ljava/lang/Exception;

    const-string v8, "Low version"

    invoke-direct {v7, v8}, Ljava/lang/Exception;-><init>(Ljava/lang/String;)V

    throw v7
    :try_end_3a
    .catch Ljava/lang/Exception; {:try_start_24 .. :try_end_3a} :catch_3a

    .line 183
    .end local v6    # "jsonObject":Lorg/json/JSONObject;
    :catch_3a
    move-exception v2

    .line 184
    .local v2, "e":Ljava/lang/Exception;
    invoke-virtual {v2}, Ljava/lang/Exception;->printStackTrace()V

    .line 187
    :try_start_3e
    new-instance v7, Lorg/json/JSONObject;

    invoke-direct {v7, v5}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    invoke-static {v7}, Lcom/brixd/niceapp/community/model/CommunityAppModel;->parseAppModels(Lorg/json/JSONObject;)Ljava/util/ArrayList;
    :try_end_46
    .catch Lorg/json/JSONException; {:try_start_3e .. :try_end_46} :catch_77

    move-result-object v1

    .line 194
    .end local v2    # "e":Ljava/lang/Exception;
    .end local v4    # "gson":Lcom/google/gson/Gson;
    :cond_47
    :goto_47
    return-object v1

    .line 169
    .end local v1    # "appModels":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/brixd/niceapp/community/model/CommunityAppModel;>;"
    :cond_48
    sget-object v7, Lcom/brixd/niceapp/community/AbsCommunityBaseFragment$AppListType;->Type_Hot:Lcom/brixd/niceapp/community/AbsCommunityBaseFragment$AppListType;

    invoke-virtual {v7}, Lcom/brixd/niceapp/community/AbsCommunityBaseFragment$AppListType;->ordinal()I

    move-result v7

    if-ne p0, v7, :cond_18

    .line 170
    sget-object v7, Lcom/brixd/niceapp/service/AppService;->mContext:Landroid/content/Context;

    invoke-static {v7}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    move-result-object v7

    const-string v8, "CommunityAppHot"

    const-string v9, ""

    invoke-virtual {v7, v8, v9}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getPref(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    goto :goto_18

    .line 181
    .restart local v1    # "appModels":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/brixd/niceapp/community/model/CommunityAppModel;>;"
    .restart local v4    # "gson":Lcom/google/gson/Gson;
    .restart local v6    # "jsonObject":Lorg/json/JSONObject;
    :cond_5f
    :try_start_5f
    const-string v7, "source"

    invoke-virtual {v6, v7}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    new-instance v8, Lcom/brixd/niceapp/service/AppService$1;

    invoke-direct {v8}, Lcom/brixd/niceapp/service/AppService$1;-><init>()V

    .line 182
    invoke-virtual {v8}, Lcom/brixd/niceapp/service/AppService$1;->getType()Ljava/lang/reflect/Type;

    move-result-object v8

    .line 181
    invoke-virtual {v4, v7, v8}, Lcom/google/gson/Gson;->fromJson(Ljava/lang/String;Ljava/lang/reflect/Type;)Ljava/lang/Object;

    move-result-object v7

    move-object v0, v7

    check-cast v0, Ljava/util/ArrayList;

    move-object v1, v0
    :try_end_76
    .catch Ljava/lang/Exception; {:try_start_5f .. :try_end_76} :catch_3a

    goto :goto_47

    .line 188
    .end local v6    # "jsonObject":Lorg/json/JSONObject;
    .restart local v2    # "e":Ljava/lang/Exception;
    :catch_77
    move-exception v3

    .line 189
    .local v3, "e1":Lorg/json/JSONException;
    invoke-virtual {v3}, Lorg/json/JSONException;->printStackTrace()V

    goto :goto_47
.end method

.method public static getCachedCommunityRankingApps()Ljava/lang/String;
    .registers 3

    .prologue
    .line 254
    sget-object v0, Lcom/brixd/niceapp/service/AppService;->mContext:Landroid/content/Context;

    invoke-static {v0}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    move-result-object v0

    const-string v1, "CommunityRankingAppsCache"

    const-string v2, ""

    invoke-virtual {v0, v1, v2}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getPref(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public static getCachedCommunityRankingUsers()Ljava/lang/String;
    .registers 3

    .prologue
    .line 258
    sget-object v0, Lcom/brixd/niceapp/service/AppService;->mContext:Landroid/content/Context;

    invoke-static {v0}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    move-result-object v0

    const-string v1, "CommunityRankingUsers"

    const-string v2, ""

    invoke-virtual {v0, v1, v2}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getPref(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public static getCachedTagsForSearch()Ljava/util/List;
    .registers 5
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/List",
            "<",
            "Lcom/brixd/niceapp/model/TagModel;",
            ">;"
        }
    .end annotation

    .prologue
    .line 110
    sget-object v2, Lcom/brixd/niceapp/service/AppService;->mContext:Landroid/content/Context;

    invoke-static {v2}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    move-result-object v2

    const-string v3, "TagsForSearch"

    const-string v4, ""

    invoke-virtual {v2, v3, v4}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getPref(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 111
    .local v1, "jsonData":Ljava/lang/String;
    invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v2

    if-eqz v2, :cond_1a

    .line 112
    new-instance v2, Ljava/util/ArrayList;

    invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V

    .line 117
    :goto_19
    return-object v2

    .line 115
    :cond_1a
    :try_start_1a
    new-instance v2, Lorg/json/JSONArray;

    invoke-direct {v2, v1}, Lorg/json/JSONArray;-><init>(Ljava/lang/String;)V

    invoke-static {v2}, Lcom/brixd/niceapp/model/TagModel;->parseTagModels(Lorg/json/JSONArray;)Ljava/util/List;
    :try_end_22
    .catch Lorg/json/JSONException; {:try_start_1a .. :try_end_22} :catch_24

    move-result-object v2

    goto :goto_19

    .line 116
    :catch_24
    move-exception v0

    .line 117
    .local v0, "e":Lorg/json/JSONException;
    new-instance v2, Ljava/util/ArrayList;

    invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V

    goto :goto_19
.end method

.method public static getCachedTopicAppModelsJsonData(I)Lorg/json/JSONObject;
    .registers 7
    .param p0, "topicId"    # I

    .prologue
    const/4 v2, 0x0

    .line 198
    sget-object v3, Lcom/brixd/niceapp/service/AppService;->mContext:Landroid/content/Context;

    invoke-static {v3}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    move-result-object v3

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "FirstLoadTopicAppsJsonData_"

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4, p0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    const-string v5, ""

    invoke-virtual {v3, v4, v5}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getPref(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 199
    .local v1, "jsonData":Ljava/lang/String;
    const-string v3, ""

    invoke-virtual {v1, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_29

    .line 205
    :goto_28
    return-object v2

    .line 203
    :cond_29
    :try_start_29
    new-instance v3, Lorg/json/JSONObject;

    invoke-direct {v3, v1}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V
    :try_end_2e
    .catch Lorg/json/JSONException; {:try_start_29 .. :try_end_2e} :catch_30

    move-object v2, v3

    goto :goto_28

    .line 204
    :catch_30
    move-exception v0

    .line 205
    .local v0, "e":Lorg/json/JSONException;
    goto :goto_28
.end method

.method public static getCachedTopicModelsJsonData()Lorg/json/JSONObject;
    .registers 6

    .prologue
    const/4 v2, 0x0

    .line 211
    sget-object v3, Lcom/brixd/niceapp/service/AppService;->mContext:Landroid/content/Context;

    invoke-static {v3}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    move-result-object v3

    const-string v4, "FirstLoadTopicJsonData"

    const-string v5, ""

    invoke-virtual {v3, v4, v5}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getPref(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 212
    .local v1, "jsonData":Ljava/lang/String;
    const-string v3, ""

    invoke-virtual {v1, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_18

    .line 218
    :goto_17
    return-object v2

    .line 216
    :cond_18
    :try_start_18
    new-instance v3, Lorg/json/JSONObject;

    invoke-direct {v3, v1}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V
    :try_end_1d
    .catch Lorg/json/JSONException; {:try_start_18 .. :try_end_1d} :catch_1f

    move-object v2, v3

    goto :goto_17

    .line 217
    :catch_1f
    move-exception v0

    .line 218
    .local v0, "e":Lorg/json/JSONException;
    goto :goto_17
.end method

.method public static getCommonEstimateEntity(II)Lcom/brixd/niceapp/db/CommonEstimateEntity;
    .registers 10
    .param p0, "id"    # I
    .param p1, "type"    # I

    .prologue
    const/4 v7, 0x0

    .line 370
    sget-object v3, Lcom/brixd/niceapp/service/AppService;->mDaoSession:Lcom/brixd/niceapp/db/DaoSession;

    invoke-virtual {v3}, Lcom/brixd/niceapp/db/DaoSession;->getCommonEstimateEntityDao()Lcom/brixd/niceapp/db/CommonEstimateEntityDao;

    move-result-object v0

    .line 371
    .local v0, "dao":Lcom/brixd/niceapp/db/CommonEstimateEntityDao;
    invoke-virtual {v0}, Lcom/brixd/niceapp/db/CommonEstimateEntityDao;->queryBuilder()Lde/greenrobot/dao/query/QueryBuilder;

    move-result-object v1

    .line 372
    .local v1, "qb":Lde/greenrobot/dao/query/QueryBuilder;, "Lde/greenrobot/dao/query/QueryBuilder<Lcom/brixd/niceapp/db/CommonEstimateEntity;>;"
    sget-object v3, Lcom/brixd/niceapp/db/CommonEstimateEntityDao$Properties;->ArticleId:Lde/greenrobot/dao/Property;

    invoke-static {p0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v4

    invoke-virtual {v3, v4}, Lde/greenrobot/dao/Property;->eq(Ljava/lang/Object;)Lde/greenrobot/dao/query/WhereCondition;

    move-result-object v3

    const/4 v4, 0x1

    new-array v4, v4, [Lde/greenrobot/dao/query/WhereCondition;

    sget-object v5, Lcom/brixd/niceapp/db/CommonEstimateEntityDao$Properties;->Type:Lde/greenrobot/dao/Property;

    invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v6

    invoke-virtual {v5, v6}, Lde/greenrobot/dao/Property;->eq(Ljava/lang/Object;)Lde/greenrobot/dao/query/WhereCondition;

    move-result-object v5

    aput-object v5, v4, v7

    invoke-virtual {v1, v3, v4}, Lde/greenrobot/dao/query/QueryBuilder;->where(Lde/greenrobot/dao/query/WhereCondition;[Lde/greenrobot/dao/query/WhereCondition;)Lde/greenrobot/dao/query/QueryBuilder;

    .line 373
    invoke-virtual {v1}, Lde/greenrobot/dao/query/QueryBuilder;->list()Ljava/util/List;

    move-result-object v2

    .line 374
    .local v2, "result":Ljava/util/List;, "Ljava/util/List<Lcom/brixd/niceapp/db/CommonEstimateEntity;>;"
    invoke-interface {v2}, Ljava/util/List;->size()I

    move-result v3

    if-lez v3, :cond_38

    .line 375
    invoke-interface {v2, v7}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/brixd/niceapp/db/CommonEstimateEntity;

    .line 378
    :goto_37
    return-object v3

    :cond_38
    const/4 v3, 0x0

    goto :goto_37
.end method

.method public static getCommunityEstimateEntity(I)Lcom/brixd/niceapp/db/CommunityEstimateEntity;
    .registers 7
    .param p0, "appId"    # I

    .prologue
    const/4 v5, 0x0

    .line 335
    sget-object v3, Lcom/brixd/niceapp/service/AppService;->mDaoSession:Lcom/brixd/niceapp/db/DaoSession;

    invoke-virtual {v3}, Lcom/brixd/niceapp/db/DaoSession;->getCommunityEstimateEntityDao()Lcom/brixd/niceapp/db/CommunityEstimateEntityDao;

    move-result-object v0

    .line 336
    .local v0, "dao":Lcom/brixd/niceapp/db/CommunityEstimateEntityDao;
    invoke-virtual {v0}, Lcom/brixd/niceapp/db/CommunityEstimateEntityDao;->queryBuilder()Lde/greenrobot/dao/query/QueryBuilder;

    move-result-object v1

    .line 337
    .local v1, "qb":Lde/greenrobot/dao/query/QueryBuilder;, "Lde/greenrobot/dao/query/QueryBuilder<Lcom/brixd/niceapp/db/CommunityEstimateEntity;>;"
    sget-object v3, Lcom/brixd/niceapp/db/CommunityEstimateEntityDao$Properties;->AppID:Lde/greenrobot/dao/Property;

    invoke-static {p0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v4

    invoke-virtual {v3, v4}, Lde/greenrobot/dao/Property;->eq(Ljava/lang/Object;)Lde/greenrobot/dao/query/WhereCondition;

    move-result-object v3

    new-array v4, v5, [Lde/greenrobot/dao/query/WhereCondition;

    invoke-virtual {v1, v3, v4}, Lde/greenrobot/dao/query/QueryBuilder;->where(Lde/greenrobot/dao/query/WhereCondition;[Lde/greenrobot/dao/query/WhereCondition;)Lde/greenrobot/dao/query/QueryBuilder;

    move-result-object v3

    invoke-virtual {v3}, Lde/greenrobot/dao/query/QueryBuilder;->list()Ljava/util/List;

    move-result-object v2

    .line 338
    .local v2, "result":Ljava/util/List;, "Ljava/util/List<Lcom/brixd/niceapp/db/CommunityEstimateEntity;>;"
    invoke-interface {v2}, Ljava/util/List;->size()I

    move-result v3

    if-lez v3, :cond_2c

    .line 339
    invoke-interface {v2, v5}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/brixd/niceapp/db/CommunityEstimateEntity;

    .line 342
    :goto_2b
    return-object v3

    :cond_2c
    const/4 v3, 0x0

    goto :goto_2b
.end method

.method public static getCommunityHotAppsLastUpdatedTime()J
    .registers 4

    .prologue
    .line 250
    sget-object v0, Lcom/brixd/niceapp/service/AppService;->mContext:Landroid/content/Context;

    invoke-static {v0}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    move-result-object v0

    const-string v1, "CommunityAppHotLastUpdatedTime"

    const-wide/16 v2, 0x0

    invoke-virtual {v0, v1, v2, v3}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getPref(Ljava/lang/String;J)J

    move-result-wide v0

    return-wide v0
.end method

.method public static getCommunityNewAppsLastUpdatedTime()J
    .registers 4

    .prologue
    .line 246
    sget-object v0, Lcom/brixd/niceapp/service/AppService;->mContext:Landroid/content/Context;

    invoke-static {v0}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    move-result-object v0

    const-string v1, "CommunityAppNewLastUpdatedTime"

    const-wide/16 v2, 0x0

    invoke-virtual {v0, v1, v2, v3}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getPref(Ljava/lang/String;J)J

    move-result-wide v0

    return-wide v0
.end method

.method public static getDaoSession()Lcom/brixd/niceapp/db/DaoSession;
    .registers 1

    .prologue
    .line 279
    sget-object v0, Lcom/brixd/niceapp/service/AppService;->mDaoSession:Lcom/brixd/niceapp/db/DaoSession;

    return-object v0
.end method

.method public static getEstimateEntity(I)Lcom/brixd/niceapp/db/EstimateEntity;
    .registers 7
    .param p0, "appId"    # I

    .prologue
    const/4 v5, 0x0

    .line 300
    sget-object v3, Lcom/brixd/niceapp/service/AppService;->mDaoSession:Lcom/brixd/niceapp/db/DaoSession;

    invoke-virtual {v3}, Lcom/brixd/niceapp/db/DaoSession;->getEstimateEntityDao()Lcom/brixd/niceapp/db/EstimateEntityDao;

    move-result-object v0

    .line 301
    .local v0, "dao":Lcom/brixd/niceapp/db/EstimateEntityDao;
    invoke-virtual {v0}, Lcom/brixd/niceapp/db/EstimateEntityDao;->queryBuilder()Lde/greenrobot/dao/query/QueryBuilder;

    move-result-object v1

    .line 302
    .local v1, "qb":Lde/greenrobot/dao/query/QueryBuilder;, "Lde/greenrobot/dao/query/QueryBuilder<Lcom/brixd/niceapp/db/EstimateEntity;>;"
    sget-object v3, Lcom/brixd/niceapp/db/EstimateEntityDao$Properties;->AppID:Lde/greenrobot/dao/Property;

    invoke-static {p0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v4

    invoke-virtual {v3, v4}, Lde/greenrobot/dao/Property;->eq(Ljava/lang/Object;)Lde/greenrobot/dao/query/WhereCondition;

    move-result-object v3

    new-array v4, v5, [Lde/greenrobot/dao/query/WhereCondition;

    invoke-virtual {v1, v3, v4}, Lde/greenrobot/dao/query/QueryBuilder;->where(Lde/greenrobot/dao/query/WhereCondition;[Lde/greenrobot/dao/query/WhereCondition;)Lde/greenrobot/dao/query/QueryBuilder;

    move-result-object v3

    invoke-virtual {v3}, Lde/greenrobot/dao/query/QueryBuilder;->list()Ljava/util/List;

    move-result-object v2

    .line 303
    .local v2, "result":Ljava/util/List;, "Ljava/util/List<Lcom/brixd/niceapp/db/EstimateEntity;>;"
    invoke-interface {v2}, Ljava/util/List;->size()I

    move-result v3

    if-lez v3, :cond_2c

    .line 304
    invoke-interface {v2, v5}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/brixd/niceapp/db/EstimateEntity;

    .line 307
    :goto_2b
    return-object v3

    :cond_2c
    const/4 v3, 0x0

    goto :goto_2b
.end method

.method public static getLastSyncDate()J
    .registers 4

    .prologue
    .line 242
    sget-object v0, Lcom/brixd/niceapp/service/AppService;->mContext:Landroid/content/Context;

    invoke-static {v0}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/suite/utils/db/SharePrefHelper;

    move-result-object v0

    const-string v1, "LastSyncDate"

    const-wide/16 v2, 0x0

    invoke-virtual {v0, v1, v2, v3}, Lcom/zuiapps/suite/utils/db/SharePrefHelper;->getPref(Ljava/lang/String;J)J

    move-result-wide v0

    return-wide v0
.end method

.method public static initialize(Landroid/content/Context;)V
    .registers 3
    .param p0, "context"    # Landroid/content/Context;

    .prologue
    .line 65
    sget-object v0, Lcom/brixd/niceapp/service/AppService;->mInstance:Lcom/brixd/niceapp/service/AppService;

    if-nez v0, :cond_13

    .line 66
    const-class v1, Lcom/brixd/niceapp/service/AppService;

    monitor-enter v1

    .line 67
    :try_start_7
    sget-object v0, Lcom/brixd/niceapp/service/AppService;->mInstance:Lcom/brixd/niceapp/service/AppService;

    if-nez v0, :cond_12

    .line 68
    new-instance v0, Lcom/brixd/niceapp/service/AppService;

    invoke-direct {v0, p0}, Lcom/brixd/niceapp/service/AppService;-><init>(Landroid/content/Context;)V

    sput-object v0, Lcom/brixd/niceapp/service/AppService;->mInstance:Lcom/brixd/niceapp/service/AppService;

    .line 70
    :cond_12
    monitor-exit v1

    .line 72
    :cond_13
    return-void

    .line 70
    :catchall_14
    move-exception v0

    monitor-exit v1
    :try_end_16
    .catchall {:try_start_7 .. :try_end_16} :catchall_14

    throw v0
.end method

.method public static insertOrReplaceCommonEstimate(Lcom/brixd/niceapp/db/CommonEstimateEntity;)V
    .registers 3
    .param p0, "entity"    # Lcom/brixd/niceapp/db/CommonEstimateEntity;

    .prologue
    .line 382
    sget-object v1, Lcom/brixd/niceapp/service/AppService;->mDaoSession:Lcom/brixd/niceapp/db/DaoSession;

    invoke-virtual {v1}, Lcom/brixd/niceapp/db/DaoSession;->getCommonEstimateEntityDao()Lcom/brixd/niceapp/db/CommonEstimateEntityDao;

    move-result-object v0

    .line 383
    .local v0, "dao":Lcom/brixd/niceapp/db/CommonEstimateEntityDao;
    invoke-virtual {v0, p0}, Lcom/brixd/niceapp/db/CommonEstimateEntityDao;->insertOrReplace(Ljava/lang/Object;)J

    .line 384
    return-void
.end method

.method public static insertOrReplaceCommunityEstimate(Lcom/brixd/niceapp/db/CommunityEstimateEntity;)V
    .registers 3
    .param p0, "entity"    # Lcom/brixd/niceapp/db/CommunityEstimateEntity;

    .prologue
    .line 346
    sget-object v1, Lcom/brixd/niceapp/service/AppService;->mDaoSession:Lcom/brixd/niceapp/db/DaoSession;

    invoke-virtual {v1}, Lcom/brixd/niceapp/db/DaoSession;->getCommunityEstimateEntityDao()Lcom/brixd/niceapp/db/CommunityEstimateEntityDao;

    move-result-object v0

    .line 347
    .local v0, "dao":Lcom/brixd/niceapp/db/CommunityEstimateEntityDao;
    invoke-virtual {v0, p0}, Lcom/brixd/niceapp/db/CommunityEstimateEntityDao;->insertOrReplace(Ljava/lang/Object;)J

    .line 348
    return-void
.end method

.method public static insertOrReplaceEstimate(Lcom/brixd/niceapp/db/EstimateEntity;)V
    .registers 3
    .param p0, "entity"    # Lcom/brixd/niceapp/db/EstimateEntity;

    .prologue
    .line 311
    sget-object v1, Lcom/brixd/niceapp/service/AppService;->mDaoSession:Lcom/brixd/niceapp/db/DaoSession;

    invoke-virtual {v1}, Lcom/brixd/niceapp/db/DaoSession;->getEstimateEntityDao()Lcom/brixd/niceapp/db/EstimateEntityDao;

    move-result-object v0

    .line 312
    .local v0, "dao":Lcom/brixd/niceapp/db/EstimateEntityDao;
    invoke-virtual {v0, p0}, Lcom/brixd/niceapp/db/EstimateEntityDao;->insertOrReplace(Ljava/lang/Object;)J

    .line 313
    return-void
.end method

.method public static isLocalAppModelExisted(Landroid/content/Context;)Z
    .registers 7
    .param p0, "context"    # Landroid/content/Context;

    .prologue
    .line 237
    sget-object v1, Lcom/brixd/niceapp/service/AppService;->mDaoSession:Lcom/brixd/niceapp/db/DaoSession;

    invoke-virtual {v1}, Lcom/brixd/niceapp/db/DaoSession;->getAppEntityDao()Lcom/brixd/niceapp/db/AppEntityDao;

    move-result-object v0

    .line 238
    .local v0, "dao":Lcom/brixd/niceapp/db/AppEntityDao;
    invoke-virtual {v0}, Lcom/brixd/niceapp/db/AppEntityDao;->count()J

    move-result-wide v2

    const-wide/16 v4, 0x0

    cmp-long v1, v2, v4

    if-lez v1, :cond_12

    const/4 v1, 0x1

    :goto_11
    return v1

    :cond_12
    const/4 v1, 0x0

    goto :goto_11
.end method
